@echo off
echo Cleaning up old virtual environment...
rmdir /s /q venv
rmdir /s /q env

echo Creating new virtual environment in different location...
python -m venv env

echo Activating virtual environment...
call env\Scripts\activate

echo Upgrading pip with domestic mirror...
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 60

echo Installing dependencies with domestic mirror...
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple PyQt5>=5.15.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple requests>=2.26.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python>=4.5.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple selenium>=4.1.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple schedule>=1.1.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple python-dateutil>=2.8.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple PyYAML>=6.0.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple Pillow>=8.0.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple tqdm>=4.62.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple pystray>=0.19.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple pyperclip>=1.8.0
pip install --timeout 60 -i https://pypi.tuna.tsinghua.edu.cn/simple watchdog>=2.1.0

echo Installation completed.
pause
